/**
 * Created by shc on 16/12/15.
 */
var React = require('react');
var ReactDOM = require('react-dom');

import { Router, Route, hashHistory } from 'react-router';

/**导航配置**/
var Main = require('./main');
var Fenlei = require('./fenlei');
var FenleiPro = require("./fenleiPro.js");
var Faxian = require('./faxian');
var Wode = require('./wode');
var PicLazy = require('./picLazy');
var Zhekou = require('./zhekou');
var NearStore = require('./near_store');
var RenWu = require('./renwu');
var ShopPro = require('./shop_pro');
var XinPin = require('./xinpin');
var Tiyan = require('./tiyan');
var Cart = require('./cart');
var UserInfo = require('./userinfo');
var MyOrders = require('./myorders');
var Register = require('./register');
var AddressInfo = require('./addressInfo');
var EditAddress = require('./editAddress');
var About = require('./about');
var GoodDetail = require('./goodDetail');
var Login = require('./login');
var LoginUserPassword = require('./loginUserPassword');
var Evaluate = require('./evaluate');
var Vip = require('./vip');
var Logistics = require('./logistics');
var LogisticsMap = require('./logisticsMap');
var CustomerService = require('./customerService');
var NewGoodDetail = require('./newGoodDetail');
var OrderInfo = require('./orderInfo');
var PaySuccess = require('./paySuccess');
var Shopbarcode = require("./shopbarcode");
var AboutShop = require("./aboutShop");
var FaxianInfo = require("./faxianInfo");
var RenwuInfo = require("./renwuInfo");
var Nikename = require("./nickname");
var TiyanInfo = require("./tiyanInfo");
var SearchGoods = require("./searchGoods");
var IntegralMall = require("./integralMall");
var IntegralRule = require("./integralRule");
var BalancePayments = require("./balancePayments");
var PointGoodDetail = require("./pointGoodDetail");
var NewExclusive = require("./newExclusive");
var NewpeopleGoodDetail = require("./newpeopleGoodDetail");
var QRcodePage = require("./QRcodePage");

var routes = (
    <Router history={hashHistory}>
        <Route path="/" component={Main} onEnter={enterHook}/>
        <Route path="/fenlei" component={Fenlei} onEnter={enterHook}/>
        <Route path="/faxian" component={Faxian} onEnter={enterHook}/>
        <Route path="/wode" component={Wode} onEnter={enterHook}/>
        <Route path="/zhekou" component={Zhekou} onEnter={enterHook}/>
        <Route path="/picLazy" component={PicLazy} onEnter={enterHook}/>
        <Route path="/near_store" component={NearStore} onEnter={enterHook}/>
        <Route path="/renwu" component={RenWu} onEnter={enterHook}/>
        <Route path="/shop_pro" component={ShopPro} onEnter={enterHook}/>
        <Route path="/xinpin" component={XinPin} onEnter={enterHook}/>
        <Route path="/tiyan" component={Tiyan} onEnter={enterHook}/>
        <Route path="/cart" component={Cart} onEnter={enterHook}/>
        <Route path="/userinfo" component={UserInfo} onEnter={enterHook}/>
        <Route path="/myorders" component={MyOrders} onEnter={enterHook}/>
        <Route path="/register" component={Register} onEnter={enterHook}/>
        <Route path="/addressInfo" component={AddressInfo} onEnter={enterHook}/>
        <Route path="/editAddress" component={EditAddress} onEnter={enterHook}/>
        <Route path="/editAddress/:id" component={EditAddress} onEnter={enterHook}/>
        <Route path="/about" component={About} onEnter={enterHook}/>
        <Route path="/goodDetail" component={GoodDetail} onEnter={enterHook}/>
        <Route path="/login" component={Login} onEnter={enterHook}/>
        <Route path="/loginUserPassword" component={LoginUserPassword} onEnter={enterHook}/>
        <Route path="/evaluate" component={Evaluate} onEnter={enterHook}/>
        <Route path="/vip" component={Vip} onEnter={enterHook}/>
        <Route path="/logistics" component={Logistics} onEnter={enterHook}/>
        <Route path="/logisticsMap" component={LogisticsMap} onEnter={enterHook}/>
        <Route path="/customerService" component={CustomerService} onEnter={enterHook}/>
        <Route path="/newGoodDetail" component={NewGoodDetail} onEnter={enterHook}/>
        <Route path="/orderInfo" component={OrderInfo} onEnter={enterHook}/>
        <Route path="/paySuccess" component={PaySuccess} onEnter={enterHook}/>
        <Route path="/shopbar/:id" component={Shopbarcode} onEnter={enterHook}/>
        <Route path="/aboutShop" component={AboutShop} onEnter={enterHook}/>
        <Route path="/faxianInfo" component={FaxianInfo} onEnter={enterHook}/>
        <Route path="/renwuInfo" component={RenwuInfo} onEnter={enterHook}/>
        <Route path="/nikename" component={Nikename} onEnter={enterHook}/>
        <Route path="/fenleiPro" component={FenleiPro} onEnter={enterHook}/>
        <Route path="/tiyanInfo" component={TiyanInfo} onEnter={enterHook}/>
        <Route path="/searchGoods" component={SearchGoods} onEnter={enterHook}/>
        <Route path="/integralMall" component={IntegralMall} onEnter={enterHook}/>
        <Route path="/integralRule" component={IntegralRule} onEnter={enterHook}/>
        <Route path="/balancePayments" component={BalancePayments} onEnter={enterHook}/>
        <Route path="/pointGoodDetail" component={PointGoodDetail} onEnter={enterHook}/>
        <Route path="/newExclusive" component={NewExclusive} onEnter={enterHook}/>
        <Route path="/newpeopleGoodDetail" component={NewpeopleGoodDetail} onEnter={enterHook}/>
        <Route path="/qrcodePage" component={QRcodePage} onEnter={enterHook}/>
    </Router>

);
function enterHook(nextState, replace, callback) {
    var pathname = nextState.location.pathname;
    callback();
}
ReactDOM.render(routes, document.getElementById('container'));
